home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-22 | 6.8 KB | 177 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- *
- * Apple Macintosh Developer Technical Support
- *
- * Installer 3.3 sample: installing a font resource into the appropriate place
- *
- * File: InstallFont.r - Rez Source
- *
- * by: Rich Kubota
- *
- * Copyright © 1991 Apple Computer, Inc.
- * All rights reserved.
- *
- *------------------------------------------------------------------------------
- * This sample installs the "Times" font resource, supplied with System 7.0.1, into
- * the appropriate place: the system file, using the new 'inff' Font Family
- * Resource Atom.
- * It allows for custom installation/removal.
- *----------------------------------------------------------------------------*/
-
- #include "Types.r" /* for the ICON resource */
- #include "InstallerTypes.r"
-
- /* You can build and complete the script with the following lines:
- # Note: set up floppies with the appropriate names and contents before running scriptcheck
- # or set up folders with the same names and contents as the floppies
- # put these folders in the same folder as the script or at the root directory of same disk
-
- rez -o "Install Font Script" -t 'bbkr' -c 'bbkr' "InstallFont.r"
- setfile -a i "Install Font Script" #mark Inited
- scriptcheck -p "Install Font Script"
- */
-
- /*
- * To create the installation disk
- * 1. Name the floppy disk "Install Font Script".
- * 2. Copy Installer 3.3 onto the floppy.
- * 3. Copy the Times font suitcase from the 7.0.1 Font Installation Disk to the floppy.
- * 4. Rez and ScriptCheck this script, and copy to the floppy.
- * 5. You're all set.
- */
-
- /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
- #define kScriptCheckSetsDate 1
- #define kTimesFontSize 287250 /* file is 287228 bytes + buffer */
-
- /* Definitions for the rules */
- #define fontRule 1000
-
- /* Defines for the file spec atoms. These are specifications for source and destination files */
- #define fsSourceFont 2000
- #define fsTargetSystem 2001
-
- /* This is the name of the source disk */
- #define FontDisk "Font Installer:"
-
- /* where we want to install our Font. */
- #define TargetPath "special-macs:"
-
- /* Definition for the packages. */
- #define pkTheFont 3000
-
- /* Definition for the font resource atom. */
- #define ffTheFont 4000
-
- /* Definition for the package comment resource */
- #define cmtTheFont 5000
- #define iconTheFont 6000
-
- /* December 10, 1991 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
- /* this value to a LongInt seconds value needed by the Installer. */
- #define currentReleaseDate 12101991
- #define currentVersion 100 /* Version 1.0 goes in the 'icmt' rsrc */
-
-
- /************************** Easy Install Rule resources **********************************/
- resource 'infr' (1) {
- format0 {{
- pickAll, {fontRule}, /* Select the Font rule */
- }};
- };
-
- resource 'inrl' (fontRule) {
- format0 {{
- addUserDescription {"Click Install button to install\n"},
- /* message to appear in Easy Install screen */
- addUserDescription {"Times Font\n"}, /* 2nd line of message */
- addPackages {{pkTheFont}} /* installing the font package */
- }};
- };
-
- /***************************** Package Resources ************************************************/
- resource 'inpk' (pkTheFont) { /* This package could include other atoms */
- format0 {
- showsOnCustom, /* Package appears in the Custom Install display */
- removable, /* Package can be removed */
- forceRestart, /* not necessary to reboot in this case */
- cmtTheFont, /* package's 'icmt' resource id */
- 0, /* Package size to be entered manually */
- /* ScriptCheck wont do this for us since it doesn't recognize */
- /* the 'inff' atom. ScriptCheck will determine the sum of */
- /* sizes of the recognized atoms and insert the sum into */
- /* this field. Use ResEdit later to modify this field to */
- /* include the font resource size. Note that the size is for */
- /* informational use only at the Custom window */
- "package which includes Times Font", { /* package name for package that shows on custom */
- 'inff', ffTheFont;
- }
- }
- };
-
- /***************************** Comments ************************************************/
- resource 'icmt' (cmtTheFont) {
- currentReleaseDate,
- currentVersion,
- iconTheFont,
- "This package includes the Times Font. "
- };
-
- resource 'ICON' (iconTheFont) {
- $"0430 4000 0A50 A000 0B91 1002 0822 0803"
- $"1224 0405 2028 0209 4010 0111 800C 00A1"
- $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
- $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
- $"0487 FE04 0288 0104 0188 0084 0088 0044"
- $"0088 0044 0088 00C4 0110 0188 0228 0310"
- $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
- $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
- };
-
-
-
- /********************************************* File Specs *******************************************/
- /* Source File Specs */
- resource 'infs' (fsSourceFont) {
- 'FFIL', /* File Type */
- 'DMOV', /* Creator */
- kScriptCheckSetsDate, /* ScriptCheck fills in the creation date */
- noSearchForFile, /* Do not search the source disk for the file */
- typeCrMustMatch, /* file type and creator on source disk must match */
- FontDisk"Times" /* Path to the file */
- };
-
- resource 'infs' (fsTargetSystem) {
- 'ZSYS', /* File Type */
- 'MACS', /* Creator */
- 0, /* creation date not needed for target file specs */
- noSearchForFile, /* Do not search the target disk for the file */
- typeCrNeedNotMatch, /* match system 6 or 7 */
- TargetPath"System" /* destination Path */
- };
-
- /*************************************** Font Family Atoms **********************************************/
- resource 'inff' (ffTheFont) {
- format0 {
- deleteWhenRemoving, /* Delete the resource if remove (option-custom) is clicked */
- dontDeleteWhenInstalling, /* dont need to delete the target before copying new one */
- copy, /* Copy rsrc to destination */
- tgtRequired, /* Target file need already exist on dest to install */
- updateExisting, /* replace any preexisting DA with the same name */
- copyIfNewOrUpdate, /* Copy whether or not target rsrc already exists */
- ignoreProtection, /* Do it even if the target rsrc is protected */
- srcNeedExist, /* Rsrc needs to exist on source disk */
- byName, /* use the name to find the source and target rsrc */
- nameMustMatch, /* this field is ignored if above is byName */
- fsTargetSystem, /* Target file spec to install rsrc into */
- fsSourceFont, /* Source file spec where to get rsrc */
- 0x20, /* 'FOND' is purgeable */
- kTimesFontSize, /* font resource size entered manually */
- 20, /* Resource ID of Times 'FOND' */
- entireFamily { /* all strikes found in FOND to be installed */
- },
- "Times Font", /* Atom description */
- "Times" /* Font Resource name */
- };
- };
-